﻿<ResourceDictionary 
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:phone="clr-namespace:System.Windows.Controls;assembly=Microsoft.Phone"
   xmlns:moad="clr-namespace:MoAds;assembly=MoAds">    
   
   
    <Style TargetType="moad:AdDisplayControl">
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="FontSize" Value="18" />
        <Setter Property="Width" Value="480"/>
        <Setter Property="Height" Value="70"/>
        <Setter Property="Background" Value="#FF1F1F1F"/>        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="moad:AdDisplayControl">
                    <Grid
                        x:Name="PART_AdRoot"
                        Height="{TemplateBinding Height}"
                        Width="{TemplateBinding Width}"
                        Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="2*" />
                            <ColumnDefinition Width="6*" />
                            <ColumnDefinition Width="2*" />
                        </Grid.ColumnDefinitions>
                        
                        <Border
                            Background="Transparent"
                            x:Name="AdImageHolder"  
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            Grid.Column="0">
                            <Image 
                                x:Name="PART_AdImage"
                                Margin="15 10"
                                Source="{TemplateBinding LoadedAdImageUri}" 
                                Stretch="Fill"
                                HorizontalAlignment="Stretch" 
                                VerticalAlignment="Stretch"/>
                        </Border>
                        
                        <TextBlock
                            Margin="3"
                            x:Name="PART_AdText"
                            Grid.Column="1"
                            FontSize="{TemplateBinding FontSize}"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"
                            TextWrapping="Wrap"
                            Foreground="{TemplateBinding Foreground}"
                            Text="{TemplateBinding LoadedAdText}"/>
                        
                        <Border
                            x:Name="AdGoHolder"                            
                            Grid.Column="2">
                            <Button
                                Margin="15 10"
                                x:Name="PART_AdGo"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch">
                                <Button.Template>
                                    <ControlTemplate TargetType="Button">
                                        <Image
                                            Source="/MoAds;component/Themes/go.png"
                                            HorizontalAlignment="Stretch"
                                            VerticalAlignment="Stretch"
                                            Stretch="Fill"/>
                                    </ControlTemplate>
                                </Button.Template>
                            </Button>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
